<?php
session_start();
require_once '../header.php';
function __autoload($className)
	{
    	require_once('../class/' . $className . '.class.php');
	}
session::need_manage();	
if(isset($_POST['fundmoney'])&&($_POST['fundmoney']==1))
{
	$Pass=rtrim(trim($_POST["pass"]));
	$UserId=$_POST["userid"];
	if(md5($Pass)=='30dc72025357a119f014c052c8b8c68c')
	{
		$Amount=$_POST["amount"];
		$Userid=$_POST["userid"];
		$Plus=database::Update('userinfo',array('userid'=>$UserId),array('money' => array( "money + {$Amount}")));
		if($Plus==TRUE)
		{
			echo "<b>Plus money Successfull</b>";
		}
	}
	else 
	{
		echo "Incorrect Password";
	}
}
else if(!empty($_GET))
{
	$UserName=$_GET["username"];
	$GetDeposit=database::LimitQuery('userinfo',array(
	'select' => 'deposit,userid,isactive,money',
	'condition' => array(
	'username'=> $UserName
	)
	));
	if(!empty($GetDeposit))
	{
	$IsActive=$GetDeposit[0]['isactive'];
	$UserId=$GetDeposit[0]['userid'];
	$Deposit=$GetDeposit[0]['deposit'];
	$LastPayment=database::LimitQuery('payment',array(
	'select' => 'date',
	'condition'=>array('userid' => $UserId),
	'order' => 'order by paymentid desc'
	));
	if(!empty($LastPayment))
	{
		$DateLastPayment=$LastPayment[0]['date'];
	}
	
	require_once '../html/showmemberdetail.php';
	}
	
}
else 
{
	require_once '../html/viewmemberdetail.php';
}



?>